package com.yeyks.task;

import com.yeyks.search.service.hotel.EsImportHotelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * mysql的数据更新
 *
 * @author: dagny
 * @date: 2019/11/15 0015 11:44
 */
@Component
@Slf4j
public class DbImportTask {

    @Autowired
    private EsImportHotelService esImportHotelService;

    /*@Scheduled(cron = "${schedule.hotel.dbData}")*/
    public void importHotelInEs() {

        log.info("开始导入Mysql的数据");

        //执行数据导入
        esImportHotelService.importHotelByPage("index_hotel");

        log.info("Mysql中的导入成功！");
    }

}
